<template>
<div class="body">
    <div>
      <NavBar
  title="业绩详情"
/>
    </div>
    <el-table :data="list">
        <el-table-column label="月份" width="50px" prop="月份"></el-table-column>
        <el-table-column  v-if="user.role.indexOf('正处') !== -1" label="履行岗位职责情况" prop="履行岗位职责情况"></el-table-column>
        <el-table-column   v-if="user.role.indexOf('书记') !== -1" label="抓基层党建工作情况" prop="抓基层党建工作情况"></el-table-column>
        
        <el-table-column label="担当作为创新发展情况" prop="担当作为创新发展情况"></el-table-column>
    </el-table>
</div>
</template>
<script>
import request from "../../utils/request"
import linq from "linq"
import NavBar from "../../components/NavBar/navBar";
export default {
    data(){
        return {
            list:[],
            user:{}
        }
    },
     components: {
    NavBar
  },
    async mounted(){
        
       var res  = await request({url:'/teacher',method:'get',params:{query:{number:this.$route.query.number}}})
       this.user = res.data[0];
       res = await request({url:'/performance',method:'get',
            params:{
                query:{"参与教师.number":this.$route.query.number,年份:'2019',cate:{$in:["正副党总支书记个人业绩","中层正职干部个人业绩"]}}
            }
        });
        this.list = linq.from(res.data).orderByDescending("parseFloat($.月份)").toArray();
        
    },
}
</script>